package xyz.sunne.qccf.controller;
/**
 * @Author Sunne
 * @Date 2018/8/20/02013:46
 * @Param qccf
 * 高山仰止,景行行止.虽不能至,心向往之。
 **/

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.sunne.base.bean.ResponseResult;
import xyz.sunne.base.util.enums.BaseEnum;
import xyz.sunne.qccf.dto.sysUser.TestDto;
import xyz.sunne.qccf.entity.system.SysUser;
import xyz.sunne.qccf.service.SysUserService;

/**
 *——————————————————————————女神保佑，永无bug——————————————————————
 *
 *                    .::::.
 *                  .::::::::.
 *                 :::::::::::  FUCK YOU
 *             ..:::::::::::'
 *           '::::::::::::'
 *             .::::::::::
 *        '::::::::::::::..
 *             ..::::::::::::.
 *           ``::::::::::::::::
 *            ::::``:::::::::'        .:::.
 *           ::::'   ':::::'       .::::::::.
 *         .::::'      ::::     .:::::::'::::.
 *        .:::'       :::::  .:::::::::' ':::::.
 *       .::'        :::::.:::::::::'      ':::::.
 *      .::'         ::::::::::::::'         ``::::.
 *  ...:::           ::::::::::::'              ``::.
 * ```` ':.          ':::::::::'                  ::::..
 *                    '.:::::'                    ':'````..
 */

@RestController
@RequestMapping(value = "/sys")
@Api(tags = {"系统用户操作"})
public class SysUserController {
    @Autowired
    SysUserService sysUserService;

    @PostMapping(value = {"/selectall"})
    @ApiOperation(value = "查询人员")
    public ResponseResult<SysUser> selectAll(@RequestBody @Validated @ApiParam(value = "用户id") TestDto user) {
        System.out.println(user.getUsername());
        SysUser sysUser = sysUserService.selectById(user.getId());
        return ResponseResult.e(BaseEnum.SUCCESS,sysUser);
    }
}
